<?php
date_default_timezone_set('PRC');
require_once dirname(__FILE__) . './models/HistoryNode.php';
require_once dirname(__FILE__) . './models/wanted.php';

$wanteds = wanted::find('all');
foreach ($wanteds as $key=>$node) { 
	$fmt_date = date('Y-m-d H:i:s', $node->date);
	$title = $node->title;
	$content = $node->content;
	$id = $node->id;
		
	echo "INSERT INTO `wanteds` (`ID`,`TITLE`,`CONTENT`,`date`) VALUES ($id,'$title','$content', $node->date);<br>";
}

	
$history_nodes = historynode::find('all');
foreach ($history_nodes as $key=>$node) { 
	$fmt_date = date('Y-m-d H:i:s', $node->date);
	$content = $node->content;
	$id = $node->id;
	
	echo "INSERT INTO `historynodes` (`ID`,`DATE`,`CONTENT`) VALUES ($id, $node->date, '$content');<br>";
}

?>